#ifndef _MOVIECLIP_H 
#define _MOVIECLIP_H


//Video player
#include <TheoraPlayer.h>
#include <SFML/Graphics.hpp>
#include <iostream>


class MovieClip : public sf::Sprite
{
	 friend class MoviePlayer;

public:
	MovieClip() {}
	MovieClip( TheoraVideoManager *mgr );
	virtual ~MovieClip(void);

//Load the movie clip
	//bool loadClip(std::string, TheoraVideoManager *mgr = NULL);

//Play movie
	void Draw(sf::RenderWindow *);

//Update frames
	void Update(float);

//Pause movie
	void togglePause();

//Auto Restart
	void Loop(bool);

	//Tell if the movie ended
	bool isFinished();
//Returns if the movie clip loaded successfully
	bool isValid();

private:

	
	TheoraVideoManager *parent_mgr;
	TheoraVideoClip *clip;

	sf::Image current_frame;

	bool started;
	bool successfully_loaded;
};


#endif